package com.leyou.item.mapper;

import com.leyou.item.domian.Brand;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;

public interface BrandMapper extends Mapper<Brand> {
    public void insertBrandAndCategory(@Param("bid") Long brandId,
                                       @Param("cids") List<Long>cids);

    @Select("SELECT b.* FROM tb_brand b, tb_category_brand cb " +
            "WHERE b.id = cb.brand_id AND cb.category_id=#{cid}")
    public List<Brand> findBrandsByCid(Long id);

}
